package com.nowcoder.community.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.nowcoder.community.util.Constants;
import lombok.Data;
import org.springframework.data.annotation.Transient;

@Data
public class LikeCountEntity {
    @Transient
    @TableField(exist = false)
    private long likeCount;

    @Transient
    @TableField(exist = false)
    private int likeStatus = Constants.LIKE_STATUS_UNLIKED;

    public String getLikeStatusText() {
        if (likeStatus == Constants.LIKE_STATUS_LIKED) {
            return "已赞";
        }
        if (likeStatus == Constants.LIKE_STATUS_UNLIKED) {
            return "赞";
        }
        return "unknown";
    }
}
